
#ifndef OLD_CONFIG_LOADER_H
#define OLD_CONFIG_LOADER_H

#define _XOPEN_SOURCE 500

#include <stdint.h>
#include "fileio.h"

//------------------PFS-----------------------
typedef struct{
	char *ip;
	uint32_t puerto;
	uint32_t maxCon;
	uint32_t tamCache;
	char *logArchPath;
}tipoConfigPFS;

tipoConfigPFS leerArchConfigPFS();

//------------------------------------------------

//------------------PRAID-----------------------
typedef struct{
	char *ip;
	uint32_t puerto;
	uint32_t flag;	//1 para activar 0 para desactivar
}tipoConfigPRAID;

tipoConfigPRAID leerArchConfigPRAID();

//------------------------------------------------

//------------------PPD-----------------------
typedef struct{
	char *ipRAID, *ipPPD;


	char *modo; //CONNECT o LISTEN
	uint32_t puertoRAID,puertoPPD;
	char algoritmo[6]; // SSTF o FSCAN
	uint32_t flag;	//1 para activar 0 para desactivar
	char *id_disco;
	uint16_t cilindro; // C
	uint8_t cabeza;    // H
	uint16_t sector;   // S
	uint16_t tiempo_lectura;
	uint16_t tiempo_escritura;
	uint16_t rpm;
	uint16_t salto_pistas;
	uint16_t imprimir;
	uint16_t maxNSTEP;
} tipoConfigPPD;

tipoConfigPPD leerArchConfigPPD(char *archivoConfig);

//------------------------------------------------

char *config_loader_open(char *path);
char *config_loader_getString(char *configBuff, char *key);
int config_loader_getInt(char *configBuff, char *key);
double config_loader_getDouble(char *configBuff, char *key);

#endif /* OLD_CONFIG_LOADER_H */
